package cn.dmp.beans

/**
  * Created by Administrator on 2018/4/19.
  */
class RichString(val value:String) {

  def String2Int:Int={
  try {
    value.toInt
  } catch {
    case _:Exception =>0
  }
  }

  def String2Double:Double={
    try {
      value.toDouble
    } catch {
      case _:Exception =>0
    }
  }
}

object RichString{

  implicit def String2Int(value: String)=new RichString(value)

}
